<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>实时库存</title>
    <th:block th:include="statics/common/page/header"></th:block>
</head>
<body>
<div id="rrapp" v-cloak>
	<div v-show="showList">
		<Row class="search-panel-space">
            <div class="search-group">
                <i-col span="2">
                	<label class="search-label-20">在途车辆:{{modelStat.routeNum}}</label>
                </i-col>
                <i-col span="2">
                	<label class="search-label-20">正常库存:{{modelStat.normalNum}}</label>
                </i-col>
                <i-col span="2">
                    <label class="search-label-20">长库存:{{modelStat.longNum}}</label>
                </i-col>
                <i-col span="2">
                    <label class="search-label-20">超长库存:{{modelStat.veryNum}}</label>
                </i-col>
                <i-col span="2">
                    <label class="search-label-20">严重超长库存:{{modelStat.veryLongNum}}</label>
                </i-col>
             </div>
        </Row>
       	<Row class="search-panel-space">
        	<div class="search-group">
                <i-col span="2">
                	<label class="search-label-20">正常库龄(45天):</label>
                </i-col>
                <i-col span="2">
                	<div style="width:40px;height:20px;border:0px solid white;background:#0066cc;"></div>
                </i-col>
                <i-col span="2">
                	<label class="search-label-20">长库龄(60天):</label>
                </i-col>
                <i-col span="2">
                	<div style="width:40px;height:20px;border:0px solid white;background:#00cc00;"></div>
                </i-col>
                <i-col span="2">
                    <label class="search-label-20">超长库龄(90天):</label>
                </i-col>
                <i-col span="2">
                    <div style="width:40px;height:20px;border:0px solid white;background:#f67816;"></div>
                </i-col>
                <i-col span="3">
                    <label class="search-label-20">严重超长库龄(120天):</label>
                </i-col>
                <i-col span="2">
                    <div style="width:40px;height:20px;border:0px solid white;background:#c00;"></div>
                </i-col>
            </div>
        </Row>
        <Row class="search-panel-space">
            <div class="search-group">
                <i-col span="5">
                	<label class="search-label-20">VIN:</label>
                    <i-input v-model="q.vin" @on-enter="query" placeholder="VIN" class="search-item-width-75"/>
                </i-col>
                <i-col span="5">
                	<label class="search-label-20">品牌:</label>
                    <i-input v-model="q.carSerie" @on-enter="query" placeholder="品牌" class="search-item-width-75"/>
                </i-col>
                <i-col span="5">
                    <label class="search-label-20">车型:</label>
                    <i-input v-model="q.carModel" @on-enter="query" placeholder="车型" class="search-item-width-75"/>
                </i-col>
                <i-col span="5">
                    <label class="search-label-20">款式:</label>
                    <i-input v-model="q.design" @on-enter="query" placeholder="款式" class="search-item-width-75"/>
                </i-col>
                <i-button @click="query">查询</i-button>
                <i-button @click="reloadSearch">重置</i-button>
            </div>
        </Row>
        <Row class="search-panel-space">
        	<i-col span="5">
                <label class="search-label-20">配置:</label>
                <i-input v-model="q.config" @on-enter="query" placeholder="配置" class="search-item-width-75"/>
            </i-col>
            <i-col span="5">
                <label class="search-label-20">外观:</label>
                <i-input v-model="q.colour" @on-enter="query" placeholder="外观" class="search-item-width-75"/>
            </i-col>
            <i-col span="5">
                <label class="search-label-20">排量:</label>
                <i-input v-model="q.displacement" @on-enter="query" placeholder="排量" class="search-item-width-75"/>
            </i-col>
            <i-col span="5">
                <label class="search-label-20">变速箱:</label>
                <i-input v-model="q.speedBox" @on-enter="query" placeholder="变速箱" class="search-item-width-75"/>
            </i-col>
            <i-col span="5">
                <label class="search-label-20">动力:</label>
                <i-input v-model="q.power" @on-enter="query" placeholder="动力" class="search-item-width-75"/>
            </i-col>
            <i-col span="5">
                <label class="search-label-20">销售人员:</label>
                <i-input v-model="q.personName" @on-enter="query" placeholder="销售人员" class="search-item-width-75"/>
            </i-col>
        </Row>    
        <Row :gutter="16">
            <div class="buttons-group">
                <i-button type="info" @click="saleCar" th:if="${@shiroAuthService.hasPermission('stockreal:sale')}">
                	<i class="fa fa-plus"></i>&nbsp;销售出库</i-button>
                <i-button type="warning" @click="update" th:if="${@shiroAuthService.hasPermission('stockreal:update')}">
                	<i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
                <i-button type="error" @click="del" th:if="${@shiroAuthService.hasPermission('stockreal:delete')}">
                	<i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
                <i-button type="info" @click="showImport" th:if="${@shiroAuthService.hasPermission('stockreal:import')}">
                    <i class="fa fa-plus"></i>&nbsp;导入</i-button>
            </div>
        </Row>
	    <table id="jqGrid"></table>
    </div>

    <Card v-show="!showList">
        <p slot="title">{{title}}</p>
		<i-form ref="formValidate" :model="stockReal" :rules="ruleValidate" :label-width="80">
            <Form-item label="车辆vin" prop="vin">
                <i-input v-model="stockReal.vin" placeholder="车辆vin"/>
            </Form-item>
            <Form-item label="合格证" prop="qualifierName">
                <i-input v-model="stockReal.qualifierName" placeholder="合格证" icon="eye" readonly="readonly" @on-click="selectProductQualifier"/>
            </Form-item>
            <Form-item label="备注" prop="content">
                <i-input v-model="stockReal.content" placeholder="备注"/>
            </Form-item>
            <Form-item>
                <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
                <i-button type="warning" @click="reload" style="margin-left: 8px"/>返回</i-button>
                <i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
            </Form-item>
        </i-form>
	</Card>
	
   	<Modal title="在途导入" v-model="modalImport" class-name="vertical-center-modal" footer-hide="true">
        <i-form>
            <Row>
                <Upload multiple type="drag" action="../stock/real/import" :on-success="impsuccess" :on-error="imperror">
                    <div style="padding: 20px 0">
                        <Icon type="ios-cloud-upload" size="52" style="color:#3399ff;"></Icon>
                        <p>点击或拖拽文件上传</p>
                    </div>
                </Upload>
            </Row>

            <Form-item>
                <i-button id="success" type="warning" @click="reloadImport" style="float:right;margin-left: 8px;"/>返回</i-button>
                <i-button type="info" @click="downFile" style="float:right;">模板下载</i-button>
            </Form-item>
        </i-form>
    </Modal>
</div>

<script th:src="@{../statics/js/stock/stockreal.js}"></script>
</body>
</html>